<template>
  <div>
    <vue-office-excel
        :src="url"
        style="height: 100vh;"
        @rendered="renderedHandler"
        @error="errorHandler"
        :options="{heightOffset: 20}"
    />
  </div>
</template>

<script>
//引入VueOfficeExcel组件
import VueOfficeExcel from "@vue-office/excel";
//引入相关样式
import "@vue-office/excel/lib/index.css";
export default {
  props: {
    url: {
      default: "",
      typeof: String,
    },
  },
  components: {
    VueOfficeExcel,
  },
  data() {
    return {};
  },
  methods: {
    renderedHandler() {
      console.log("渲染完成");
    },
    errorHandler() {
      console.log("渲染失败");
    },
  },
};
</script>
